<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<div div="app">
    <input type="text" v-mode="com">
    <button @click="sub">发表评论</button>
    <div v-for="msg in msgs">
        {{msg}}
    </div>
</div>
<script>
    var vm = new Vue({
        el:'#app',
        data: {
            com:'',
            msgs:[]
        },
        methods: {
            sub(){
                this.mags.push(this.com);
                this.com = ""
            }
        }

    })
</script>
</body>